package com.campus.wall.presenter;

import android.app.Activity;
import android.app.AlertDialog;
import android.os.Environment;
import android.util.Log;
import android.widget.Toast;

import androidx.annotation.Nullable;

import com.alibaba.fastjson.JSON;
import com.campus.wall.base.BasePresenter;
import com.campus.wall.contract.LoginContract;
import com.self.baseutile.components.ToastUtils;

import java.sql.Time;
import java.util.Calendar;
import java.util.Map;

import okhttp3.RequestBody;
import okhttp3.ResponseBody;
import retrofit2.Call;


/**
 * Description：
 */
public class LoginPresenter extends BasePresenter<LoginContract.View> implements LoginContract.Presenter {

    private Activity activity;
    public LoginPresenter(Activity activity) {
        this.activity=activity;
    }

    @Override
    public void login(String name,String pass) {
        //View是否绑定 如果没有绑定，就不执行网络请求
        if (!isViewAttached()) {
            return;
        }
       if(name.equals("2023") && pass.equals("123456")){
           mView.onSuccess();
       }else {
           ToastUtils.Warnshow("账户或者密码错误");
       }

    }



}
